package de.abuwipp.jee6atdd.domain1;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.pages.Pages;
import net.thucydides.core.steps.ScenarioSteps;

public class EndUserSteps extends ScenarioSteps {

    public EndUserSteps(Pages pages) {
        super(pages);
    }

    private Feature1Page onFeature1Page() {
        return getPages().currentPageAt(Feature1Page.class);
    }

    private Feature1Page Feature1Page() {
        return getPages().currentPageAt(Feature1Page.class);
    }

    @Step
    public void should_see_title(String expectedTitle) {
        String actualTitle = Feature1Page().getTitleOfContent();
        assertThat(actualTitle, is(expectedTitle));
    }

    @Step
    public void is_on_page_feature1() {
        onFeature1Page().open();
    }

}
